package org.jiamandan.com.config;

import lombok.AllArgsConstructor;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @version Revision 1.0.1
 * @版权：版权所有 (c) 2021
 * @author:jmd
 * @see:
 * @创建日期：2022-10-21 15:53
 * @功能说明：
 * @begin
 * @修改记录:
 * @修改后版本 修改人        修改内容
 * @2022-10-21 15:53	         jmd        	创建
 * @end
 */
@Async
@Component
@AllArgsConstructor
public class NettyStartListener implements ApplicationRunner {

    private NettyServer nettyServer;
    private NettyProperties nettyProperties;

    @Override
    public void run(ApplicationArguments args) throws Exception {
//        this.nettyServer.start();
        this.nettyServer.startNettyServer(nettyProperties.getPorts());
    }
}
